# 题目：输入2024-02-25，输出这一天是这年的第几天
date = input("请输入日期：")
# 加0 ，索引与月份一致
days = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

# print("2024-10-1".split("-"))
arr = date.split("-")
year = int(arr[0])
month = int(arr[1])
day = int(arr[2])

fa = 28
# if (year % 400 == 0) | ((year % 4 == 0) & (year % 100 != 0)):
if not year % 400 or (not year % 4 and year % 100):
    print("闰年")
    fa = 29

days[2] = fa
print(days)

s = 0

# 方式一
# for i, v in enumerate(days):
#     if i < month:
#         s += v
#     else:
#         break


# 方式二
for i in range(month):
    s += days[i]

s += day
print("当年的第%d天" % s)
